package my.edu.model.bills.purchase.service;

import cn.hutool.json.JSONObject;
import com.baomidou.mybatisplus.extension.service.IService;
import my.edu.common.domain.OrderProductDetail;
import my.edu.common.domain.PageDTO;
import my.edu.common.domain.PageVO;
import my.edu.common.myInterface.GetOne;
import my.edu.model.bills.purchase.entity.PurchaseOrder;
import my.edu.model.bills.purchase.entity.PurchaseReturnOrder;
import my.edu.model.bills.purchase.entity.dto.PurchaseDTO;
import my.edu.model.bills.purchase.entity.dto.PurchaseOrderSearchDTO;
import my.edu.model.bills.purchase.entity.dto.PurchaseReturnDTO;
import my.edu.model.bills.purchase.entity.vo.PurchaseOrderVO;

import java.math.BigDecimal;
import java.time.YearMonth;
import java.util.List;
import java.util.Map;

public interface IPurchaseOrderService extends IService<PurchaseOrder>, GetOne {

    void saveNew(PurchaseDTO purchaseDTO,String status);

    void removeOrder( List<Long>  ids);

    void updateOrder(PurchaseDTO purchaseDTO, String status);

    void auditOrder(List<Long> ids);

    void rauditOrder(List<Long> ids);

    PageVO<PurchaseOrderVO> getPurchaseOrderPage(PageDTO page, PurchaseOrderSearchDTO purchaseOrderSearchDTO);

    //直接修改对应购货单
    void updatePurchaseReturnOrderId(PurchaseReturnOrder purchaseReturnOrder,List<OrderProductDetail> orderProductDetails);

    //去掉原来购货单的退货状态，改为新的
    void updatePurchaseReturnOrderId(List<Long> returnOrderIds,PurchaseReturnOrder purchaseReturnOrder,List<OrderProductDetail> orderProductDetails);

    //去掉购货单的退货状态
    void removePurchaseReturnOrderId(List<Long> returnOrderIds);

    List<PurchaseOrderVO> listOnly(PurchaseOrderSearchDTO purchaseOrderSearchDTO);

    void checkPurchaseOrder(PurchaseReturnDTO purchaseReturnDTO);

    BigDecimal getTodayPurchase();

    BigDecimal getMonthPurchase();

    BigDecimal getYesterdayPurchase();

    BigDecimal getYearPurchase();

    Map<YearMonth, BigDecimal> getPurchasePriceList();

    JSONObject getPurchaseReportList(PageDTO pageDTO, PurchaseOrderSearchDTO purchaseOrderSearchDTO);
}
